#ifndef __MTOOLS_H__
#define __MTOOLS_H__

#include <stdint.h>
#include <time.h>
#include "platformconfig.h"

/*********************************************************************/
void *m_memcpy(void *dst,const void *src,int count);
int m_memcmp(const void*cs,const void*ct,int count);
void *(m_memset)(void *s,int c,int n);
int m_memchr(const void *buffer,int ch,int count);
int m_strlen(const char *string);
char *m_strcpy(char *dst, const char *src);
uint16_t getCRC16(uint8_t *buffer, uint16_t buffer_length);
uint8_t checkCRC16(uint8_t *msg, const uint16_t msg_length, uint8_t overturn);
uint8_t getCRC8(uint8_t *pbuf,uint8_t len);
uint8_t checkCRC8(uint8_t *p,uint8_t len);
uint8_t DEC2BCD(uint8_t val);
uint8_t BCD2DEC(uint8_t val);
uint8_t BCD2HEX(uint8_t val);
uint8_t HEX2BCD(uint8_t val);
void Hex2Ascii(uint8_t val,uint8_t *string,uint8_t mode);
struct tm Time_ConvUnixToCalendar(time_t t);
time_t Time_ConvCalendarToUnix(struct tm t);
void OutputDebugBuf(uint8_t *buf,uint16_t buflen,void(*Fun)(const char *fmt, ...));
#endif

